package com.minimalist.common.entity.lindi.vo.tradeapplicationcontract;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.minimalist.common.config.mybatis.bo.PageReq;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 林地指标交易平台_交易申请合同查询VO
 *
 * @author 11987
 */
@Schema(name = "林地指标交易平台_交易申请合同查询实体")
public class LindiTradeApplicationContractQueryVO extends PageReq implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(name = "tradeApplicationId", description = "交易申请ID", type = "string")
    private Long tradeApplicationId;

    @Schema(name = "contractName", description = "合同名称", type = "string")
    private String contractName;

    @Schema(name = "contractType", description = "合同类型", type = "string")
    private String contractType;

    @Schema(name = "contractNumber", description = "合同编号", type = "string")
    private String contractNumber;

    @Schema(name = "effectiveDate", description = "签订日期", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime effectiveDate;

    public LindiTradeApplicationContractQueryVO() {
    }

    public LindiTradeApplicationContractQueryVO(Long tradeApplicationId, String contractName, String contractType, String contractNumber, LocalDateTime effectiveDate) {
        this.tradeApplicationId = tradeApplicationId;
        this.contractName = contractName;
        this.contractType = contractType;
        this.contractNumber = contractNumber;
        this.effectiveDate = effectiveDate;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public String getContractName() {
        return contractName;
    }

    public void setContractName(String contractName) {
        this.contractName = contractName;
    }

    public String getContractType() {
        return contractType;
    }

    public void setContractType(String contractType) {
        this.contractType = contractType;
    }

    public String getContractNumber() {
        return contractNumber;
    }

    public void setContractNumber(String contractNumber) {
        this.contractNumber = contractNumber;
    }

    public LocalDateTime getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(LocalDateTime effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        LindiTradeApplicationContractQueryVO that = (LindiTradeApplicationContractQueryVO) o;

        if (tradeApplicationId != null ? !tradeApplicationId.equals(that.tradeApplicationId) : that.tradeApplicationId != null) return false;
        if (contractName != null ? !contractName.equals(that.contractName) : that.contractName != null) return false;
        if (contractType != null ? !contractType.equals(that.contractType) : that.contractType != null) return false;
        if (contractNumber != null ? !contractNumber.equals(that.contractNumber) : that.contractNumber != null) return false;
        return effectiveDate != null ? effectiveDate.equals(that.effectiveDate) : that.effectiveDate == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (tradeApplicationId != null ? tradeApplicationId.hashCode() : 0);
        result = 31 * result + (contractName != null ? contractName.hashCode() : 0);
        result = 31 * result + (contractType != null ? contractType.hashCode() : 0);
        result = 31 * result + (contractNumber != null ? contractNumber.hashCode() : 0);
        result = 31 * result + (effectiveDate != null ? effectiveDate.hashCode() : 0);
        return result;
    }
}
